const base = require('./webpack.common');
const { merge } = require('webpack-merge');

const path = require('path');

const prod_config = {
  mode: 'production',
  output: {
    filename: 'prod_bundle.[hash:8].js',
    path: path.join(__dirname, 'dist')
  },
  optimization: {
    //tree shakeing
    usedExports:true, //标记未引用代码
    minimize:true, //压缩去掉未引用代码
    splitChunks: {
        chunks: 'all'
    }
},
  stats: "errors-only",
  module: {
    rules: []
  }
  
};

module.exports = merge(base, prod_config);